<?php
/**
 * CreateUser: zlh
 * CreateTime: 2022/4/11 11:52
 * Remark:
 */

namespace App\Models\Approval;

use App\Consts\TableConsts\TableConsts;
use App\Models\BaseModel;

class OldDingTalkApprovalInstanceModel extends BaseModel
{
    protected $table  = TableConsts::CY_DING_TALK_APPROVAL_INSTANCE_TABLE_NAME;

    protected $fillable = [
        'ding_talk_approval_instance_id',
        'process_id',
        'form_component',
        'create_time',
        'finish_time',
        'operation_records',
    ];

    /**
     * 新增审批
     * @param $talkApprovalData
     * @return mixed
     */
    public function addTalkApproval($talkApprovalData): mixed
    {
        return $this->insertGetId($talkApprovalData);
    }


    public function getTalkApprovalInfo($processId,$select = ["*"]){
        return $this
            ->where("ding_talk_approval_process_id",$processId)
            ->select($select)
            ->first();
    }
}